package com.fc.test.controller.admin;

import com.fc.test.common.base.BaseController;
import com.fc.test.common.domain.AjaxResult;
import com.fc.test.model.auto.TAbbCommission;
import com.fc.test.model.custom.TableSplitResult;
import com.fc.test.model.custom.Tablepar;
import com.fc.test.model.custom.TitleVo;
import com.fc.test.service.TAbbCommissionService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@RequestMapping("TAbbTongjiController")
@Api(value = "")
public class TAbbTongjiController extends BaseController{

	private String prefix = "admin/tAbbTongji";
	@Autowired
	private TAbbCommissionService tAbbCommissionService;

	//Logical.OR是指value 中的权限任选其一  Logical.AND是指value 中的权限都要有，默认为and
	@GetMapping("view")
	@RequiresPermissions("gen:tAbbTongji:view")
    public String view(Model model)
     {
		String str="";
		setTitle(model, new TitleVo("列表", str+"管理", true,"欢迎进入"+str+"页面", true, false));
			return prefix + "/list";
		}


	@PostMapping("list")
	@RequiresPermissions("gen:tAbbTongji:list")
	@ResponseBody
	public Object list(Tablepar tablepar,String searchTxt,String starttime,String endtime){
		PageInfo<Map> page=tAbbCommissionService.tongji(tablepar,searchTxt,starttime,endtime);
		TableSplitResult<Map> result=new TableSplitResult<Map>(page.getPageNum(), page.getTotal(), page.getList());
		return  result;
	}



}
